package com.mlody.chapter1;

import com.mlody.chapter1.interfaces.FlyBehavior;
import com.mlody.chapter1.interfaces.QuackBehavior;

/**
 * Created by tmlod_000 on 2014-07-27.
 */
public class Duck {
    private FlyBehavior flyBehavior;
    private QuackBehavior quackBehavior;

    public void setFlyBehavior(FlyBehavior flyBehavior) {
        this.flyBehavior = flyBehavior;
    }

    public void setQuackBehavior(QuackBehavior quackBehavior) {
        this.quackBehavior = quackBehavior;
    }

    public void performQuack(){
        quackBehavior.quack();

    };
    public void performFly(){
        flyBehavior.fly();
    };
    public void swim(){};
    public void display(){
        System.out.println("Looks like a Duck");
    }
}
